<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: pcl::PointDataAtOffset&lt; PointT &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classpcl_1_1_point_data_at_offset.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="classpcl_1_1_point_data_at_offset-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">pcl::PointDataAtOffset&lt; PointT &gt; 模板类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>A datatype that enables type-correct comparisons.  
 <a href="classpcl_1_1_point_data_at_offset.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="conditional__removal_8h_source.html">conditional_removal.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:aae1a4254769ba7d51802e4fc66a0369c"><td class="memItemLeft" align="right" valign="top"><a id="aae1a4254769ba7d51802e4fc66a0369c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_point_data_at_offset.html#aae1a4254769ba7d51802e4fc66a0369c">PointDataAtOffset</a> (uint8_t datatype, uint32_t offset)</td></tr>
<tr class="memdesc:aae1a4254769ba7d51802e4fc66a0369c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:aae1a4254769ba7d51802e4fc66a0369c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8713ce3dcb0a169674d8fff2bd8e1bb6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_point_data_at_offset.html#a8713ce3dcb0a169674d8fff2bd8e1bb6">compare</a> (const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;p, const double &amp;val)</td></tr>
<tr class="memdesc:a8713ce3dcb0a169674d8fff2bd8e1bb6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare function.  <a href="classpcl_1_1_point_data_at_offset.html#a8713ce3dcb0a169674d8fff2bd8e1bb6">更多...</a><br /></td></tr>
<tr class="separator:a8713ce3dcb0a169674d8fff2bd8e1bb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a657d66c7a7a684fcf71e998490711acb"><td class="memItemLeft" align="right" valign="top"><a id="a657d66c7a7a684fcf71e998490711acb"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_point_data_at_offset.html#a657d66c7a7a684fcf71e998490711acb">datatype_</a></td></tr>
<tr class="memdesc:a657d66c7a7a684fcf71e998490711acb"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of data. <br /></td></tr>
<tr class="separator:a657d66c7a7a684fcf71e998490711acb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e7e5046db8c86652e5609dd8c31de82"><td class="memItemLeft" align="right" valign="top"><a id="a9e7e5046db8c86652e5609dd8c31de82"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">offset_</a></td></tr>
<tr class="memdesc:a9e7e5046db8c86652e5609dd8c31de82"><td class="mdescLeft">&#160;</td><td class="mdescRight">The data offset. <br /></td></tr>
<tr class="separator:a9e7e5046db8c86652e5609dd8c31de82"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><h3>template&lt;typename PointT&gt;<br />
class pcl::PointDataAtOffset&lt; PointT &gt;</h3>

<p>A datatype that enables type-correct comparisons. </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a8713ce3dcb0a169674d8fff2bd8e1bb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8713ce3dcb0a169674d8fff2bd8e1bb6">&#9670;&nbsp;</a></span>compare()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classpcl_1_1_point_data_at_offset.html">pcl::PointDataAtOffset</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::compare </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compare function. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the point to compare </td></tr>
    <tr><td class="paramname">val</td><td>the value to compare the point to </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;{</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;  <span class="comment">// if p(data) &gt; val return 1</span></div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;  <span class="comment">// if p(data) == val return 0</span></div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;  <span class="comment">// if p(data) &lt; val return -1 </span></div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;  </div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;  <span class="keyword">const</span> uint8_t* pt_data = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span> (&amp;p);</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160; </div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;  <span class="keywordflow">switch</span> (<a class="code" href="classpcl_1_1_point_data_at_offset.html#a657d66c7a7a684fcf71e998490711acb">datatype_</a>) </div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;  {</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;    <span class="keywordflow">case</span> pcl::PCLPointField::INT8 :</div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;    {</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;      int8_t pt_val;</div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;      memcpy (&amp;pt_val, pt_data + this-&gt;<a class="code" href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">offset_</a>, <span class="keyword">sizeof</span> (int8_t));</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;      <span class="keywordflow">return</span> (pt_val &gt; <span class="keyword">static_cast&lt;</span>int8_t<span class="keyword">&gt;</span>(val)) - (pt_val &lt; static_cast&lt;int8_t&gt; (val));</div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;    }</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;    <span class="keywordflow">case</span> pcl::PCLPointField::UINT8 :</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;    {</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;      uint8_t pt_val;</div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;      memcpy (&amp;pt_val, pt_data + this-&gt;<a class="code" href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">offset_</a>, <span class="keyword">sizeof</span> (uint8_t));</div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;      <span class="keywordflow">return</span> (pt_val &gt; <span class="keyword">static_cast&lt;</span>uint8_t<span class="keyword">&gt;</span>(val)) - (pt_val &lt; static_cast&lt;uint8_t&gt; (val));</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;    }</div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;    <span class="keywordflow">case</span> pcl::PCLPointField::INT16 :</div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;    {</div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;      int16_t pt_val;</div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;      memcpy (&amp;pt_val, pt_data + this-&gt;<a class="code" href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">offset_</a>, <span class="keyword">sizeof</span> (int16_t));</div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;      <span class="keywordflow">return</span> (pt_val &gt; <span class="keyword">static_cast&lt;</span>int16_t<span class="keyword">&gt;</span>(val)) - (pt_val &lt; static_cast&lt;int16_t&gt; (val));</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;    }</div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;    <span class="keywordflow">case</span> pcl::PCLPointField::UINT16 :</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;    {</div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;      uint16_t pt_val;</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;      memcpy (&amp;pt_val, pt_data + this-&gt;<a class="code" href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">offset_</a>, <span class="keyword">sizeof</span> (uint16_t));</div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;      <span class="keywordflow">return</span> (pt_val &gt; <span class="keyword">static_cast&lt;</span>uint16_t<span class="keyword">&gt;</span> (val)) - (pt_val &lt; static_cast&lt;uint16_t&gt; (val));</div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;    }</div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;    <span class="keywordflow">case</span> pcl::PCLPointField::INT32 :</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;    {</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;      int32_t pt_val;</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;      memcpy (&amp;pt_val, pt_data + this-&gt;<a class="code" href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">offset_</a>, <span class="keyword">sizeof</span> (int32_t));</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;      <span class="keywordflow">return</span> (pt_val &gt; <span class="keyword">static_cast&lt;</span>int32_t<span class="keyword">&gt;</span> (val)) - (pt_val &lt; static_cast&lt;int32_t&gt; (val));</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;    }</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;    <span class="keywordflow">case</span> pcl::PCLPointField::UINT32 :</div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;    {</div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;      uint32_t pt_val;</div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;      memcpy (&amp;pt_val, pt_data + this-&gt;<a class="code" href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">offset_</a>, <span class="keyword">sizeof</span> (uint32_t));</div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;      <span class="keywordflow">return</span> (pt_val &gt; <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span> (val)) - (pt_val &lt; static_cast&lt;uint32_t&gt; (val));</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;    }</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;    <span class="keywordflow">case</span> pcl::PCLPointField::FLOAT32 :</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;    {</div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;      <span class="keywordtype">float</span> pt_val;</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;      memcpy (&amp;pt_val, pt_data + this-&gt;<a class="code" href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">offset_</a>, <span class="keyword">sizeof</span> (<span class="keywordtype">float</span>));</div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;      <span class="keywordflow">return</span> (pt_val &gt; <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span> (val)) - (pt_val &lt; static_cast&lt;float&gt; (val));</div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;    }</div>
<div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;    <span class="keywordflow">case</span> pcl::PCLPointField::FLOAT64 :</div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;    {</div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;      <span class="keywordtype">double</span> pt_val;</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;      memcpy (&amp;pt_val, pt_data + this-&gt;<a class="code" href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">offset_</a>, <span class="keyword">sizeof</span> (<span class="keywordtype">double</span>));</div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;      <span class="keywordflow">return</span> (pt_val &gt; val) - (pt_val &lt; val);</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;    }</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;    default : </div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;      PCL_WARN (<span class="stringliteral">&quot;[pcl::pcl::PointDataAtOffset::compare] unknown data_type!\n&quot;</span>);</div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;      <span class="keywordflow">return</span> (0);</div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;  }</div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;}</div>
<div class="ttc" id="aclasspcl_1_1_point_data_at_offset_html_a657d66c7a7a684fcf71e998490711acb"><div class="ttname"><a href="classpcl_1_1_point_data_at_offset.html#a657d66c7a7a684fcf71e998490711acb">pcl::PointDataAtOffset::datatype_</a></div><div class="ttdeci">uint8_t datatype_</div><div class="ttdoc">The type of data.</div><div class="ttdef"><b>Definition:</b> conditional_removal.h:77</div></div>
<div class="ttc" id="aclasspcl_1_1_point_data_at_offset_html_a9e7e5046db8c86652e5609dd8c31de82"><div class="ttname"><a href="classpcl_1_1_point_data_at_offset.html#a9e7e5046db8c86652e5609dd8c31de82">pcl::PointDataAtOffset::offset_</a></div><div class="ttdeci">uint32_t offset_</div><div class="ttdoc">The data offset.</div><div class="ttdef"><b>Definition:</b> conditional_removal.h:80</div></div>
</div><!-- fragment -->
</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>filters/include/pcl/filters/<a class="el" href="conditional__removal_8h_source.html">conditional_removal.h</a></li>
<li>filters/include/pcl/filters/impl/<a class="el" href="conditional__removal_8hpp_source.html">conditional_removal.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>pcl</b></li><li class="navelem"><a class="el" href="classpcl_1_1_point_data_at_offset.html">PointDataAtOffset</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
